export default {
    namespaced: true,
    state: {
        role: "",
        user: {
            username: '',
            token: ""
        }
    },
    mutations: {
        setRole(state, role) {
            state.role = role
        },
        setUser(state, user) {
            state.user = {
                username: user.username,
                token: user.token
            }
        },
        clearState(state) {
            state.user = {
                username: '',
                token: ""
            }
        }
    }
}